package com.ztstkj.lzservices.extension

import java.io.PrintWriter
import java.io.StringWriter

object ExceptionExt {
    fun Throwable.toStackTraceString(): String {
        return StringWriter().use { sw ->
            PrintWriter(sw).use { pw ->
                this.printStackTrace(pw)
                sw.toString()
            }
        }
    }
}